Method and apparatus for encoding/decoding intra prediction mode

ABSTRACT

Provided are method and apparatus methods and apparatuses for encoding an intra-prediction mode based on a secondary IPM. The present invention may comprises a first decision step of determining whether an intra-prediction mode of a current block is included in a first candidate mode set including M candidate modes (M is an integer equal to or greater than 1); a second decision step of determining whether the intra-prediction mode of the current block is included in a second candidate mode set including N candidate modes (N is an integer equal to or greater than 1) based on a first determination result representing a determination result of the first decision step; and an intra prediction mode encoding step of encoding the intra-prediction mode of the current block based on the first determination result or a second determination result representing a determination result of the second decision step.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of application Ser. No. 17/886,154filed on Aug. 11, 2022, which is a continuation of application Ser. No.15/772,284 filed on Apr. 30, 2018, which is a U.S. National StageApplication of International Application No. PCT/KR2016/013363, filed onNov. 18, 2016, which claims the benefit under 35 USC 119(a) and 365(b)of Korean Patent Application No. 10-2015-0162747, filed on Nov. 19,2015, and Korean Patent Application No. 10-2016-0089419, filed on Jul.14, 2016 in the Korean Intellectual Property Office.

TECHNICAL FIELD

The present invention relates generally to a method and apparatus forencoding/decoding for signaling an intra prediction mode in an imageencoding/decoding.

BACKGROUND ART

As broadcasting having High Definition (HD) resolution broadcasting isextended and provided nationwide and worldwide, many users have becomeaccustomed to images having high resolution and high picture quality.Accordingly, many institutions are providing an impetus for thedevelopment of the next generation image devices. Furthermore, as thereis a growing interest in Ultra High Definition (UHD), which has aresolution for times higher than HDTV, there is a need for technology inwhich an image having higher resolution and higher picture quality canbe compressed and processed.

As an image compression technology, there are various technologies suchas an inter-prediction technology in which pixel values included in acurrent picture are predicted from pictures before or after the currentpicture, an intra-prediction technology in which pixel values includedin a current picture are predicted using pixel information in thecurrent picture, a transformation and quantization technology forcompressing energy of residual signals, and an entropy encodingtechnology in which a short code is allocated to a value having highappearance frequency and a long code is allocated to a value having lowappearance frequency. The image data may be transmitted and stored in astate in which it is effectively compressed using these imagecompression technologies.

In order to transmit all information generated while encoding/decoding,an amount of bits required to be transmitted may be increased. Inparticular, while encoding a slice in an intra mode in a low bit rateenvironment, the amount of bits for intra prediction mode is predictedto occupy a large portion of the total amount of bits, so an improvementplan is required.

DISCLOSURE Technical Problem

The present invention is intended to propose a method and apparatus forefficiently encoding/decoding an image.

In addition, the present invention provides a method and apparatus forefficiently encoding/decoding an intra-prediction mode.

In addition, the present invention provides a method and apparatus forreducing an amount of bits required for a transmission of anintra-prediction mode.

In addition, the present invention provides a method and apparatus forreducing an amount of bits generated for transmitting intra-predictionmodes when an intra-prediction mode of a current encoding block isdetermined through a rate-distortion optimization process as the numberof the intra-prediction modes is increased.

Technical Solution

According to one aspect of the present invention, there is provided amethod for encoding an image, the method including: a first decisionstep of determining whether an intra-prediction mode of a current blockis included in a first candidate mode set including M candidate modes (Mis an integer equal to or greater than 1); a second decision step ofdetermining whether the intra-prediction mode of the current block isincluded in a second candidate mode set including N candidate modes (Nis an integer equal to or greater than 1) based on a first determinationresult representing a determination result of the first decision step;and an intra prediction mode encoding step of encoding theintra-prediction mode of the current block based on the firstdetermination result or a second determination result representing adetermination result of the second decision step.

According to the encoding method of the present invention, when theintra-prediction mode of the current block is determined to be includedin the first candidate mode set at the first decision step, the intraprediction mode encoding step may encode result information about thefirst determination result and first indication information forindicating a candidate mode which is the same as the intra-predictionmode of the current block among the M candidate modes included in thefirst candidate mode set.

According to the encoding method of the present invention, when theintra-prediction mode of the current block is determined not to beincluded in the first candidate mode set at the first decision step andwhen the intra-prediction mode of the current block is determined to beincluded in the second candidate mode set at the second decision step,the intra prediction mode encoding step may encode information about thefirst determination result, information about the second determinationresult, and second indication information for indicating a candidatemode which is the same as the intra-prediction mode of the current blockamong the N candidate modes included in the second candidate mode set.

According to the encoding method of the present invention, when theintra-prediction mode of the current block is determined not to beincluded in the first candidate mode set at the first decision step andwhen the intra-prediction mode of the current block is determined not tobe included in the second candidate mode set at the second decisionstep, the encoding step may encode information about the firstdetermination result, information about the second determination result,and third indication information for indicating a mode which is the sameas the intra-prediction mode of the current block among a plurality ofmodes each of which is not included in either the first candidate modeset or the second candidate mode set.

According to the encoding method of the present invention, the candidatemode included in the second candidate mode set may be determined basedon at least one reference prediction mode that is selected from thecandidate mode included in the first candidate mode set, and thereference prediction mode may be an angular mode.

According to the encoding method of the present invention, when thefirst candidate mode set includes a plurality of the angular modes, thereference prediction mode may be at least one of a maximum value, aminimum value, an average value, a median value derived from theplurality of the angular modes or an intra-prediction mode derived froman available block adjacent to the current block.

According to the encoding method of the present invention, the candidatemode included in the second candidate mode set may be selected fromprediction modes smaller than the reference prediction mode andprediction modes greater than the reference prediction mode according toa predetermined interval.

According to the encoding method of the present invention, the methodmay further comprise encoding step of encoding information indicatingwhether the second candidate mode set is used for encoding an intraprediction mode of a block included in the image.

According to the encoding method of the present invention, the methodmay further comprise encoding of encoding information about the number Mindicating the number of candidate modes included in the first candidatemode set or information about the number N indicating the number ofcandidate modes included in the second candidate mode.

According to the encoding method of the present invention, the methodmay further comprise an additional decision step, in addition to thefirst and second decision steps, and the intra prediction mode encodingstep may be performed based on a determination result of the additionaldecision step.

According to another aspect of the present invention, there is provideda method for decoding an image comprising: decoding candidate mode setselecting information and candidate mode selecting information;selecting a candidate mode set based on the candidate mode set selectinginformation; and selecting one candidate mode among at least onecandidate mode included in the candidate mode set based on the candidatemode selecting information as an intra-prediction mode of a currentblock, wherein the candidate mode set selecting information isinformation for selecting a candidate mode set used for deriving theintra-prediction mode of the current block among at least one candidatemode set.

According to the decoding method of the present invention, the at leastone candidate mode set may include at least one of a first candidatemode set including M candidate modes (M is an integer equal to orgreater than 1) and a second candidate mode set including N candidatemodes (N is an integer equal to or greater than 1). According to thedecoding method of the present invention, when the first candidate modeset is selected based on the candidate mode set selecting information,the candidate mode selecting information may be information forindicating one candidate mode among the M candidate modes included inthe first candidate mode set.

According to the decoding method of the present invention, when thesecond candidate mode set is selected based on the candidate mode setselecting information, the candidate mode selecting information may beinformation for indicating one candidate mode among the N candidatemodes included in the second candidate mode set.

According to the decoding method of the present invention, when neitherthe first nor second candidate mode sets is selected based on thecandidate mode set selecting information, the candidate mode selectinginformation may be information for indicating one candidate mode amongat least one candidate mode that is not included in either the first orsecond candidate mode sets.

According to the decoding method of the present invention, the candidatemode included in the second candidate mode set may be determined basedon at least one reference prediction mode that is selected from thecandidate modes included in the first candidate mode set, and thereference prediction mode may be an angular mode.

According to the decoding method of the present invention, when thefirst candidate mode set includes a plurality of the angular modes, thereference prediction mode may be at least one of a maximum value, aminimum value, an average value, a median value derived from theplurality of the angular modes or an intra-prediction mode derived froman available block adjacent to the current block.

According to the decoding method of the present invention, the candidatemode included in the second candidate mode set may be selected fromprediction modes smaller than the reference prediction mode andprediction modes greater than the reference prediction mode according toa predetermined interval.

According to the decoding method of the present invention, the methodmay further comprise decoding information indicating whether the secondcandidate mode set is used for decoding an intra prediction mode of ablock included in the image.

According to the decoding method of the present invention, the methodmay further comprise decoding information about the number M indicatingthe number of candidate modes included in the first candidate mode setor information about the number N indicating the number of candidatemodes included in the second candidate mode.

Advantageous Effects

According to the present invention, an image may be efficientlyencoded/decoded.

In addition, according to the present invention, an intra-predictionmode may be efficiently encoded/decoded during.

Further, according to the present invention, an amount of bits requiredfor a transmission of an intra-prediction mode may be reduced.

Further, according to the present invention, when the number ofintra-prediction modes is increased, encoding efficiency fortransmitting an intra prediction mode may be improved.

DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram showing a configuration of an image encodingapparatus to which an embodiment of the present invention is applied.

FIG. 2 is a block diagram showing a configuration of an image decodingapparatus to which an embodiment of the present invention is applied.

FIG. 3 is a diagram schematically showing a partition structure of animage when encoding the image.

FIG. 4 is a diagram showing forms of a prediction unit (PU) that may beincluded in a coding unit (CU).

FIG. 5 is a diagram showing forms of a transform unit (TU) that may beincluded in a coding unit (CU).

FIG. 6 is a diagram showing an example of intra-prediction process.

FIG. 7 is a diagram explaining an example of an inter-predictionprocess.

FIG. 8 is a flow chart explaining an encoding method of anintra-prediction mode according to an embodiment of the presentinvention.

FIG. 9 is a flow chart explaining a decoding method of anintra-prediction mode according to an embodiment of the presentinvention.

FIG. 10 is a diagram explaining intra-prediction modes in which up to 35intra-prediction modes are supported as the intra-prediction mode of animage.

FIG. 11 is a diagram explaining intra-prediction modes in which up to 67intra-prediction modes are supported as the intra-prediction mode of animage.

FIG. 12 is a diagram explaining an example of configuration of 6 MPMcandidate modes when up to 67 intra-prediction modes are supported.

FIG. 13 is a diagram explaining various embodiments of configuringsecondary IPM candidate based on MPM candidate configured according to afirst case (Case 1) of FIG. 12 .

FIG. 14 is a diagram explaining various embodiments of configuringsecondary IPM candidate based on MPM candidate configured according to asecond case (Case 2) and a fifth case (Case 5) of FIG. 12 .

FIG. 15 is a diagram explaining various embodiments of configuringsecondary IPM candidate based on an MPM candidate configured accordingto a fourth case (Case 4) of FIG. 12 .

MODE FOR INVENTION

Since a variety of modifications may be made to the present inventionand there are various embodiments of the present invention, exampleswill now be provided with reference to drawings and will be described indetail. However, the present invention is not limited thereto, and theexemplary embodiments can be construed as including all modifications,equivalents, or substitutes in a technical concept and a technical scopeof the present invention. The similar reference numerals refer to thesame or similar functions in various aspects. In the drawings, theshapes and dimensions of elements may be exaggerated for clarity, andthe same reference numerals will be used throughout to designate thesame or like elements. In the following detailed description of thepresent invention, references are made to the accompanying drawings thatshow, by way of illustration, specific embodiments in which theinvention may be practiced. These embodiments are described insufficient detail to enable those skilled in the art to implement thepresent disclosure. It should be understood that various embodiments ofthe present disclosure, although different, are not necessarily mutuallyexclusive. For example, specific features, structures, andcharacteristics described herein, in connection with one embodiment, maybe implemented within other embodiments without departing from thespirit and scope of the present disclosure. In addition, it should beunderstood that the location or arrangement of individual elementswithin each disclosed embodiment may be modified without departing fromthe spirit and scope of the present disclosure. The following detaileddescription is, therefore, not to be taken in a limiting sense, and thescope of the present disclosure is defined only by the appended claims,appropriately interpreted, along with the full range equivalent to whatthe claims claim.

Terms used in the specification, ‘first’, ‘second’, etc. can be used todescribe various components, but the components are not to be construedas being limited to the terms. The terms are only used to differentiateone component from other components. For example, the ‘first’ componentmay be named the ‘second’ component without departing from the scope ofthe present invention and the ‘second’ component may also be similarlynamed the ‘first’ component. The term ‘and/or’ includes a combination ofa plurality of items or any one of a plurality of terms.

When an element is mentioned to be “coupled” or “connected” to anotherelement, this may mean that it is directly coupled or connected to theother element, but it is to be understood that yet another element mayexist in-between. On the other hand, when an element is mentioned to be“directly coupled” or “directly connected” to another element, it is tobe understood that there are no other elements in-between.

Furthermore, constitutional parts shown in the embodiments of thepresent invention are independently shown so as to representcharacteristic functions different from each other. Thus, it does notmean that each constitutional part is constituted in a constitutionalunit of separated hardware or software. In other words, eachconstitutional part includes each of enumerated constitutional parts forconvenience. Thus, at least two constitutional parts of eachconstitutional part may be combined to form one constitutional part orone constitutional part may be divided into a plurality ofconstitutional parts to perform each function. The embodiment where eachconstitutional part is combined and the embodiment where oneconstitutional part is divided are also included in the scope of thepresent invention, if not departing from the essence of the presentinvention.

The terms used in the present specification are merely used to describeparticular embodiments, and are not intended to limit the presentinvention. An expression used in the singular encompasses the expressionof the plural, unless it has a clearly different meaning in the context.In the present specification, it is to be understood that terms such as“including”, “having”, etc., are intended to indicate the existence ofthe features, numbers, steps, actions, elements, parts, or combinationsthereof disclosed in the specification, and are not intended to precludethe possibility that one or more other features, numbers, steps,actions, elements, parts, or combinations thereof may exist or may beadded. In other words, when a specific element is referred to as being“included”, elements other than the corresponding element are notexcluded, but additional elements may be included in embodiments of thepresent invention or the scope of the present invention.

In addition, some of constituents may not be indispensable constituentsperforming essential functions of the present invention but be selectiveconstituents improving only performance thereof. The present inventionmay be implemented by including only the indispensable constitutionalparts for implementing the essence of the present invention except theconstituents used in improving performance. The structure including onlythe indispensable constituents except the selective constituents used inimproving only performance is also included in the scope of the presentinvention.

Hereinafter, exemplary embodiments of the present invention will bedescribed in detail with reference to the accompanying drawings. Indescribing exemplary embodiments of the present invention, well-knownfunctions or constructions will not be described in detail since theymay unnecessarily obscure the understanding of the present invention.The same constituent elements in the drawings are denoted by the samereference numerals, and a repeated description of the same elements willbe omitted.

In addition, hereinafter, an image may refer to a picture constituting avideo, or may refer to a video. For example, “encoding and/or decodingan image” may refer to “encoding and/or decoding a video”, or may referto “encoding and/or decoding a single image among images constituting avideo”. Herein, the picture may refer to an image.

Encoder: may refer to an encoding apparatus.

Decoder: may refer to a decoding apparatus.

Parsing: may refer to determining a syntax element value by performingentropy decoding, or may refer to an entropy decoder.

Block: may refer to a sample of an M×N matrix. Herein, M and N arepositive integers. A block may refer to a sample matrix of a twodimensional matrix.

Unit: may refer to a unit of encoding or decoding an image. Whenencoding and decoding an image, a unit may be an area generated bypartitioning an image. Alternatively, a unit may refer to a divided unitof one image when the image is sub-divided and encoded or decoded. Whileencoding and decoding, a predetermined process may be performed for eachunit. A single unit may be divided into smaller sub-units. The unit mayalso refer to a block, a macro block (MB), a coding unit (CU), aprediction unit (PU), a transform unit (TU), a coding block (CB), aprediction block (PB), or a transform block (TB) according to a functionthereof. The unit may refer to a luma component block to bedistinguished from the block, a chroma component block in response tothe luma component block, and may refer to each block including a syntaxelement thereof. The unit may have various sizes and shapes. Inparticular, the shape of the unit may include two-dimensional forms suchas a rectangle, cube, trapezoid, triangle, pentagon, etc. In addition,the shape of the unit may include a geometrical figure. Further, unitinformation may include at least one of a unit type such as encodingunit, prediction unit, transform unit, etc.; a unit size; a unit depth;and a sequence of unit encoding and decoding, etc.

Reconstructed neighbor unit: may refer to a reconstructed unit that isalready spatially/temporally encoded or decoded, and adjacent to anencoding/decoding target unit.

Depth: indicates a degree of partitions of a unit. In a tree structure,the highest node may refer to a root node, and the lowest node may referto a leaf node.

Symbol: may refer to a syntax element and a coding parameter of anencoding/decoding target unit, a value of transform coefficient, etc.

Parameter set: may correspond to header information in a structurewithin a bit stream. At least one of a video parameter set, a sequenceparameter set, a picture parameter set, and an adaptation parameter setmay be included in the parameter set. In addition, the parameter set mayinclude information of a slice header and a tile header.

Bitstream: may refer to a bit string including encoded imageinformation.

Coding parameter: may include not only information encoded by an encoderand then transmitted to a decoder along with a syntax element, but alsoinformation that may be derived in an encoding or decoding process, ormay refer to a parameter necessary for encoding and decoding. Forexample, the coding parameter may include at least one value and/orstatistic of an intra-prediction mode, an inter-prediction mode, anintra-prediction direction, motion information, a motion vector, areference image index, an inter-prediction direction, aninter-prediction indicator, a reference image list, a motion vectorpredictor, a motion merge candidate, a type of transform, a size oftransform, information about whether or not an additional transform isused, filter information within a loop, information about whether or nota residual signal is present, a quantization parameter, a context model,a transform coefficient, a transform coefficient level, a coded blockpattern, a coded block flag, an image displaying/outputting order, sliceinformation, tile information, a picture type, information about whetheror not a motion merge mode is used, information about whether or not askip mode is used, a block size, a block depth, block partitioninformation, a unit size, unit partition information, etc.

Prediction unit: may refer to a basic unit when performing interprediction or intra prediction, and when performing compensation for theprediction. The prediction unit may be divided into multiple partitions.Each of the partitions may also be the basic unit when performing interprediction or intra prediction, and when performing the compensation forthe prediction. The partitioned prediction unit may also refer to aprediction unit. In addition, a single prediction unit may be dividedinto smaller sub-units. The prediction unit may have various sizes andshapes. In particular, the shape of the unit may include two-dimensionalforms such as a rectangle, square, trapezoid, triangle, pentagon, etc.In addition, the shape of the unit may include a geometrical figure.

Prediction unit partition: may refer to a partitioning form of aprediction unit.

Reference picture list: may refer to a list including at least onereference picture that is used for inter prediction or motioncompensation. Types of the reference list may include a list combined(LC), L0 (List 0), L1 (List 1), L2 (List 2), L3 (List 3), etc. At leastone reference picture list may be used for inter prediction.

Inter-prediction indicator: may refer to an inter-prediction direction(unit-direction prediction, bi-direction prediction) of anencoding/decoding target block. Alternatively, the indicator may referto a number of reference pictures used for generating a prediction blockof the encoding/decoding target block, or may refer to a number ofprediction blocks used when the encoding/decoding target block performsmotion compensation.

Reference picture index: may refer to an index of a specific picturewithin a reference picture list.

Reference picture: may refer to a reference picture that is referencedby a specific unit used for inter prediction or motion compensation.Alternately, a reference image may refer to a reference picture.

Motion vector: refers to a two-dimensional matrix used for interprediction or motion compensation, or may be an offset between anencoding/decoding target image and a reference image. For example, (mvX,mvY) may indicate a moving vector, mvX may be a horizontal component,and mvY may be vertical component.

Motion vector candidate: may refer to a unit that becomes a predictioncandidate when predicting a motion vector, or may refer to a movingvector of the unit.

Motion vector candidate list: may refer to a list configured with amoving vector candidate.

Motion vector candidate index: may refer to an indicator that indicatesa motion vector candidate within a moving vector candidate list, or mayrefer to an index of a motion vector predictor.

Motion information: may refer to information including at least one of amotion vector, a reference image index, an inter-prediction indicator,reference image list information, a reference image, a motion vectorcandidate, a motion vector candidate index, etc.

Transform unit: may refer to a basic unit when performingencoding/decoding of a residual signal such as transform, inversetransform, quantization, inverse quantization, and encoding/decoding oftransform coefficient. A single unit may be divided into smallersub-units. The unit may have various sizes and shapes. In particular,the shape of the unit may include a two-dimensional form such as arectangle, square, trapezoid, triangle, pentagon, etc. In addition, theshape of the unit may also include a geometrical figure.

Scaling: may refer to a process of multiplying a factor to a transformcoefficient level, and as a result, a transform coefficient may begenerated. The scaling may also refer to inverse quantization.

Quantization parameter: may refer to a value used for scaling atransform coefficient level in a quantization and inverse quantization.Herein, a quantization parameter may be a value mapped to a step size ofthe quantization.

Delta quantization parameter: may refer to a residual value between apredicted quantization parameter and a quantization parameter of anencoding/decoding target unit.

Scan: may refer to a method of sorting coefficient orders within a blockor a matrix. For example, sorting a two-dimensional matrix to a onedimensional matrix may refer to scanning or inverse scanning.

Transform coefficient: may be a coefficient value generated afterperforming a transform. In the present invention, a transformcoefficient level that is quantized by applying quantization to atransform coefficient may be included in the transform coefficient.

Non-zero transform coefficient: may refer to a transform coefficient inwhich a value thereof or a size thereof is not 0.

Quantization matrix: may refer to a matrix used for quantization andinverse quantization in order to improve quality of an image. Thequantization matrix may also refer to a scaling list.

Quantization matrix coefficient: may refer to each element of aquantization matrix. The quantization matrix coefficient may also referto a matrix coefficient.

Default matrix: may refer to a predetermined quantization matrix definedin an encoder and a decoder in advance.

Non-default matrix: may refer to a quantization matrix transmittedfrom/received by a user, and is not defined in an encoder and a decoderin advance.

FIG. 1 is a block diagram showing a configuration of an image encodingapparatus to which an embodiment of the present invention is applied.

The encoding apparatus 100 may be a video encoding apparatus or an imageencoding apparatus. A video may include at least one image. The encodingapparatus 100 may encode the at least one image of the video in order oftime.

Referring to FIG. 1 , the encoding apparatus 100 may include a motionprediction unit 111, motion compensation unit 112, an intra-predictionunit 120, a switch 115, a subtractor 125, a transformation unit 130, aquantization unit 140, an entropy encoding unit 150, a inversequantization unit 160, an inverse transformation unit 170, an adder 175,a filter unit 180, and a reference picture buffer 190.

The encoding apparatus 100 may encode an input image in an intra mode oran inter mode or both. In addition, the encoding apparatus 100 maygenerate a bitstream by encoding the input image, and may output thegenerated bitstream. When the intra mode is used as a prediction mode,the switch 115 may be switched to intra. When the inter mode is used asa prediction mode, the switch 115 may be switched to inter. Herein, theintra mode may be referred to as an intra-prediction mode, and the intermode may be referred to as an inter-prediction mode. The encodingapparatus 100 may generate a prediction signal of an input block of theinput image. The prediction signal, which is a block unit, may bereferred to as a prediction block. In addition, after generating theprediction block, the encoding apparatus 100 may encode a residual valuebetween the input block and the prediction block. The input image may bereferred to as a current image that is a target of a current encoding.The input block may be referred to as a current block or as an encodingtarget block that is a target of the current encoding.

When the prediction mode is the intra mode, the intra-prediction unit120 may use a pixel value of a previously encoded block adjacent to thecurrent block as a reference pixel. The intra-prediction unit 120 mayperform spatial prediction by using the reference pixel for spatialprediction, and may generate prediction samples of the input block byusing the spatial prediction. Herein, intra prediction may meanintra-frame prediction.

When the prediction mode is the inter mode, the motion prediction unit111 may search for a region that is optimally matched with the inputblock of a reference image in a motion predicting process, and mayderive a motion vector by using the searched region. The reference imagemay be stored in the reference picture buffer 190.

The motion compensation unit 112 may generate the prediction block byperforming motion compensation using the motion vector. Herein, themotion vector may be a two-dimensional vector that is used in interprediction. In addition, the motion vector may indicate an offsetbetween the current image and the reference image. Herein, interprediction may refer to an inter-frame prediction.

When a value of the motion vector is not an integer, the motionprediction unit 111 and the motion compensation unit 112 may generatethe prediction block by applying an interpolation filter to a partialregion in the reference image. In order to perform inter prediction orthe motion compensation, based on the coding unit, a motion predictionmethod of the prediction unit included in the coding unit and acompensation method of the motion prediction may be determined among askip mode, a merge mode, and an AMVP mode. In addition, the interprediction or the motion compensation may be performed depending on themodes.

The subtractor 125 may generate a residual block by using the residualvalue between the input block and the prediction block. The residualblock may be referred to as a residual signal.

The transformation unit 130 may generate a transform coefficient bytransforming the residual block, and may output the transformcoefficient. Herein, the transform coefficient may be a coefficientvalue generated by transforming the residual block. In a transform skipmode, the transformation unit 130 may skip the transformation of theresidual block.

A quantized transform coefficient level may be generated by applyingquantization to the transform coefficient. Hereinafter, the quantizedtransform coefficient level may be referred to as the transformcoefficient in the embodiments of the present invention.

The quantization unit 140 may generate the quantized transformcoefficient level by quantizing the transform coefficient according tothe quantization parameter, and may output the quantized transformcoefficient level. Here, the quantization unit 140 may quantize thetransform coefficient by using a quantization matrix.

The entropy encoding unit 150, according to the probabilitydistribution, may generate the bitstream by performing entropy encodingon values calculated by the quantization unit 140 or on coding parametervalues calculated in an encoding process, etc., and may output thebitstream. The entropy encoding unit 150 may entropy encode informationfor decoding an image, and information of a pixel of an image. Forexample, the information for decoding an image may include a syntaxelement, etc.

When the entropy encoding is applied, symbols are represented byallocating a small number of bits to the symbols having high occurrenceprobability and allocating a large number of bits to the symbols havinglow occurrence probability, thereby reducing the size of the bitstreamof encoding target symbols. Therefore, compression performance of theimage encoding may be increased through the entropy encoding. For theentropy encoding, the entropy encoding unit 150 may use an encodingmethod such as exponential golomb, context-adaptive variable lengthcoding (CAVLC), and context-adaptive binary arithmetic coding (CABAC).For example, the entropy encoding unit 150 may entropy encode by using avariable length coding/code (VLC) table. In addition, the entropyencoding unit 150 may derive a binarization method of the target symboland a probability model of a target symbol/bin, and may performarithmetic coding by using the derived binarization method or thederived probability model thereafter.

In order to encode the transform coefficient level, the entropy encodingunit 150 may change a two-dimensional block form coefficient into aone-dimensional vector form by using a transform coefficient scanningmethod. For example, the two-dimensional block form coefficient may bechanged into the one-dimensional vector form by scanning the coefficientof the block with up-right scanning. According to the size of thetransform unit and the intra prediction mode, vertical scanning thatscans the two-dimensional block form coefficient in column direction,and horizontal scanning that scans the two-dimensional block formcoefficient in a row direction may be used rather than up-rightscanning. In other words, the scanning method among up-right scanning,vertical direction scanning, and horizontal direction scanning may bedetermined according to the size of the transform unit and theintra-prediction mode.

The coding parameter may include not only information encoded by anencoder and then delivered to a decoder along with a syntax element, butalso information that may be derived in an encoding or decoding process,or may refer to a parameter necessary for encoding and decoding. Forexample, the coding parameter may include at least one value orstatistic of an intra-prediction mode, an inter-prediction mode, anintra-prediction direction, motion information, a motion vector, areference image index, an inter-prediction direction, aninter-prediction indicator, a reference image list, a motion vectorpredictor, a motion merge candidate, a type of transform, a size oftransform, information about whether or not an additional transform isused, filter information within a loop, information about whether or nota residual signal is present, a quantization parameter, a context model,a transform coefficient, a transform coefficient level, a coded blockpattern, a coded block flag, an image displaying/outputting order, sliceinformation, tile information, a picture type, information about whetheror not a motion merge mode is used, information about whether or not askip mode is used, a block size, a block depth, block partitioninformation, a unit size, unit partition information, etc.

The residual signal may mean the difference between the original signaland the prediction signal. Alternatively, the residual signal may be asignal generated by transforming the difference between the originalsignal and the prediction signal. Alternatively, the residual signal maybe a signal generated by transforming and quantizing the differencebetween the original signal and the prediction signal. The residualblock may be the residual signal, which is a block unit.

When the encoding apparatus 100 performs encoding by using interprediction, the encoded current image may be used as the reference imagefor another image(s) that will be processed thereafter. Therefore, theencoding apparatus 100 may decode the encoded current image, and maystore the decoded image as the reference image. In order to perform thedecoding, inverse quantization and inverse transformation may beperformed on the encoded current image.

A quantized coefficient may be dequantized by the inverse quantizationunit 160, and may be inversely transformed by the inverse transformationunit 170. The dequantized and inversely transformed coefficient may beadded to the prediction block by the adder 175, whereby a reconstructedblock may be generated.

The reconstructed block may pass the filter unit 180. The filter unit180 may apply at least one of a deblocking filter, a sample adaptiveoffset (SAO), and an adaptive loop filter (ALF) to the reconstructedblock or a reconstructed image. The filter unit 180 may be referred toas an in-loop filter.

The deblocking filter may remove block distortion that occurs atboundaries between the blocks. In order to determine whether or not thedeblocking filter is operated, it is possible to determine whether ornot the deblocking filter is applied to the current block based onpixels included in several rows or columns in the block. When thedeblocking filter is applied to the block, a strong filter or a weakfilter may be applied depending on required deblocking filteringstrength. In addition, in applying the deblocking filter, horizontaldirection filtering and vertical direction filtering may be processed inparallel when performing vertical filtering and horizontal filtering.

The sample adaptive offset may add an optimum offset value to the pixelvalue in order to compensate for an encoding error. The sample adaptiveoffset may correct an offset between the deblocking filtered image andthe original image by a pixel. In order to perform the offset correctionon a specific picture, it is possible to use a method of applying anoffset correction in consideration of edge information of each pixel ora method of partitioning pixels of an image into a predetermined numberof regions, determining a region to be subjected to perform an offsetcorrection, and applying the offset correction to the determined region.

The adaptive loop filter may filter based on a value obtained bycomparing the reconstructed image and the original image. Pixels of animage may be partitioned into predetermined groups, a single filterbeing applied to each of the groups is determined, and differentfiltering may be performed at each of the groups. Information aboutwhether or not the adaptive loop filter is applied may be transmitted toeach coding unit (CU). A shape and a filter coefficient of an adaptiveloop filter being applied to each block may vary. In addition, anadaptive loop filter having the same form (fixed form) may be appliedregardless of characteristics of a target block.

The reconstructed block having passed the filter unit 180 may be storedin the reference picture buffer 190.

FIG. 2 is a block diagram showing a configuration of an image decodingapparatus to which an embodiment of the present invention is applied.

The decoding apparatus 200 may be a video decoding apparatus or an imagedecoding apparatus.

Referring to FIG. 2 , the decoding apparatus 200 may include an entropydecoding unit 210, a inverse quantization unit 220, an inversetransformation unit 230, an intra-prediction unit 240, motioncompensation unit 250, an adder 255, a filter unit 260, and a referencepicture buffer 270.

The decoding apparatus 200 may receive the bitstream outputted from theencoding apparatus 100. The decoding apparatus 200 may decode thebitstream in the intra mode or the inter mode. In addition, the decodingapparatus 200 may generate a reconstructed image by decoding, and mayoutput the reconstructed image.

When the intra mode is used as a prediction mode used in decoding, theswitch may be switched to intra. When the inter mode is used as theprediction mode used in decoding, the switch may be switched to inter.

The decoding apparatus 200 may obtain the reconstructed residual blockfrom the inputted bitstream, and may generate the prediction block.

When the reconstructed residual block and the prediction block areobtained, the decoding apparatus 200 may generate the reconstructedblock, which is a decoding target block, by adding the reconstructedresidual block and the prediction block. The decoding target block maybe referred to as a current block.

The entropy decoding unit 210 may generate symbols by entropy decodingthe bitstream according to the probability distribution. The generatedsymbols may include a symbol having a form of a quantized transformcoefficient level.

Herein, a method of entropy decoding may be similar to theabove-described method of the entropy encoding. For example, the methodof entropy decoding may be an inverse process of the above-describedmethod of entropy encoding.

In order to decode the transform coefficient level, the entropy decodingunit 210 may change a one-dimensional block form coefficient into atwo-dimensional vector form by using a transform coefficient scanningmethod. For example, the one-dimensional block form coefficient may bechanged into the two-dimensional vector form by scanning the coefficientof the block with up-right scanning. According to the size of thetransform unit and the intra-prediction mode, vertical scanning andhorizontal scanning may be used rather than up-right scanning. In otherwords, the scanning method among up-right scanning, vertical directionscanning, and horizontal direction scanning may be determined accordingto the size of the transform unit and the intra-prediction mode.

The quantized transform coefficient level may be dequantized by theinverse quantization unit 220, and may be inversely transformed by theinverse transformation unit 230. The quantized transform coefficientlevel is dequantized and is inversely transformed so as to generate areconstructed residual block. Here, the inverse quantization unit 220may apply the quantization matrix to the quantized transform coefficientlevel.

When the intra mode is used, the intra-prediction unit 240 may generatea prediction block by performing the spatial prediction that uses thepixel value of the previously decoded block around the decoding targetblock.

When the inter mode is used, the motion compensation unit 250 maygenerate the prediction block by performing motion compensation thatuses both the motion vector and the reference image stored in thereference picture buffer 270. When the value of the motion vector is notan integer, the motion compensation unit 250 may generate the predictionblock by applying the interpolation filter to the partial region in thereference image. In order to perform motion compensation, based on thecoding unit, a motion prediction method of the prediction unit includedin the coding unit and a compensation method of the motion predictionmay be determined among a skip mode, a merge mode, an AMVP mode, and acurrent picture reference mode. In addition, the inter prediction or themotion compensation may be performed depending on the modes. Herein, thecurrent picture reference mode may mean a prediction mode using apreviously reconstructed region within the current picture having thedecoding target block. The previously reconstructed region may be notadjacent to the decoding target block. In order to specify thepreviously reconstructed region, a fixed vector may be used for thecurrent picture reference mode. In addition, a flag or an indexindicating whether or not the decoding target block is a block decodedin the current picture reference mode may be signaled, and may bederived by using the reference picture index of the decoding targetblock. The current picture for the current picture reference mode mayexist at a fixed position (for example, a position of refIdx=0 or thelast position) within the reference picture list for the decoding targetblock. In addition, it is possible to be variably positioned within thereference picture list, and to this end, an additional reference pictureindex indicating a position of the current picture may be signaled.

The reconstructed residual block may be added to the prediction block bythe adder 255. A block generated by adding the reconstructed residualblock and the prediction block may pass the filter unit 260. The filterunit 260 may apply at least one of the deblocking filter, the sampleadaptive offset, and the adaptive loop filter to the reconstructed blockor to the reconstructed image. The filter unit 260 may output thereconstructed image. The reconstructed image may be stored in thereference picture buffer 270, and may be used in inter prediction.

FIG. 3 is a diagram schematically showing the partition structure of animage when encoding and decoding the image. FIG. 3 schematically showsan example of partitioning a single unit into a plurality of units of alower layer.

In order to efficiently partition an image, a coding unit (CU) may beused while encoding and decoding. A unit may refer to 1) a syntaxelement, and 2) a block including sample images. For example, “apartition of a unit” may refer to “a partition of a block correspondingto the unit”. Block partitioning information may include depthinformation of the unit. The depth information may indicate a number ofpartitions in the unit and/or a degree of partitioning.

Referring to FIG. 3 , an image 300 is sequentially partitioned in thelargest coding unit (hereinafter referred to as an LCU), and a partitionstructure is determined based on the LCUs. Herein, the LCU may be usedas a coding tree unit (CTU). A single unit may include depth informationbased on a tree structure and may be hierarchically partitioned. Each ofpartitioned unit of a lower layer may include depth information. Thedepth information indicates a number of partitions in the unit and/or adegree of partitioning, and thus may include unit size information ofthe lower layer.

The partition structure may refer to a distribution of coding units(CUs) within the LCU 310. The CU may be a unit used for efficientlyencoding an image. The distribution may be determined based on whetheror not a single CU will be partitioned in plural (a positive integermore than 2 including 2, 4, 8, 16, etc.). A width size and a height sizeof each partitioned CU may be a half width size and a half height sizeof the single CU. Alternatively, the width size and the height size ofeach partitioned CU may be smaller than the width size and the heightsize of the single CU according to a number of partitioned units.Likewise, the partitioned CU may be recursively partitioned in aplurality of CUs each reduced by half in a width size and a height sizefrom the partitioned CU.

Herein, the partition of a CU may be recursively performed up to apredetermined depth. Depth information may be information indicating asize of the CU. Depth information of each CU may be stored therein. Forexample, the depth of an LCU may be 0, and the depth of the smallestcoding unit (SCU) may be a predetermined maximum depth. Herein, the LCUmay be a CU having a maximum CU size as described above, and the SCU maybe a CU having a minimum CU size.

Whenever the LCU 310 is partitioned and a width size and a height sizethereof are reduced, the depth of a CU is increased by 1. A CU on whichpartitioning has not been performed may have a 2N×2N size for eachdepth, and a CU on which partitioning has been performed may bepartitioned from a CU having a 2N×2N size to a plurality of CUs eachhaving an N×N size. The size of N is reduced by half whenever the depthis increased by 1.

Referring to FIG. 3 , the size of an LCU having a minimum depth of 0 maybe 64×64 pixels, and the size of a SCU having a maximum depth of 3 maybe 8×8 pixels. Herein, the LCU having 64×64 pixels may be represented bya depth of 0, a CU having 32×32 pixels may be represented by a depth of1, a CU having 16×16 pixels may be represented by a depth of 2, and theSCU having 8×8 pixels may be represented by a depth of 3.

Further, information about whether or not a specific CU will bepartitioned may be represented through 1-bit partition information foreach CU. All CUs, except for the SCU, may include the partitioninformation. For example, when a CU is not partitioned, partitioninformation may be 0. Alternatively, when a CU is partitioned, partitioninformation may be 1.

FIG. 4 is a diagram showing the forms of a prediction unit (PU) that maybe included in a CU.

A CU that is no longer partitioned, from among CUs partitioned from theLCU, may be partitioned into at least one PU. Such a process may alsorefer to partitioning.

A prediction unit (PU) may be a basic unit of a prediction. The PU maybe encoded and decoded in any one of a skip mode, inter-prediction mode,and intra-prediction mode. The PU may be partitioned in various formsdepending on each mode.

As shown in FIG. 4 , in the skip mode, there may not be a partitionwithin the CU. In addition, a 2N×2N mode 410 having the same size as aCU may be supported without a partition within the CU.

In the inter-prediction mode, 8 partitioned forms, for example, the2N×2N mode 410, a 2N×2N mode 415, an N×2N mode 420, an N×N mode 425, a2N×nU mode 430, a 2N×nD mode 435, an nL×2N mode 440, and an nR×2N mode445 may be supported within a CU.

FIG. 5 is a diagram showing forms of a transform unit (TU) that may beincluded in a CU.

A transform unit (TU) may be a basic unit used for a transformation, aquantization, a reverse transform, and a inverse quantization processwithin a CU. The TU may have a rectangular or square form. The TU may bedependently determined by a size and/or a form of a CU.

A CU that is no longer partitioned, from among CUs partitioned from theLCU, may be partitioned into one or more TUs. Herein, the partitionstructure of the TU may be a quad-tree structure. For example, as shownin FIG. 5 , a single CU 510 may be partitioned once or more depending ona quad-tree structure, so that the CU 510 is formed of TUs havingvarious sizes. Alternatively, the single CU 510 may be partitioned intoat least one TU based in a number of horizontal lines and/or verticallines that partition the CU. The CU may be partitioned into TUs that aresymmetrical to each other, or may be partitioned into TUs that areasymmetrical to each other. In order to partition into asymmetrical TUs,information of size and form of the TU may be signaled, or may bederived from information of size and form of the CU.

While performing a transform, a residual block may be transformed byusing one of predetermined methods. For example, the predeterminedmethods may include a discrete cosine transform (DCT), a discrete sinetransform (DST), or a Karhunen-Loève transform (KLT). In order todetermine the method of transforming the residual block, the method maybe determined by using at least one of inter-prediction mode informationof the prediction unit, intra-prediction mode information of theprediction unit, or a size and form of the transform block.Alternatively, information indicating the method may be signaled in somecases.

FIG. 6 is a diagram showing an example of showing an intra-predictionmode.

A number of intra-prediction modes may vary according to a size of aprediction unit (PU), or may be fixed to N numbers regardless of thesize of the prediction unit (PU). Herein, the N numbers may include 35,and 67, or may be a positive integer more than 1. For example, apredetermined intra-prediction mode of an encoder/decoder may includetwo non-angular modes and 65 angular modes, as shown in FIG. 6 . The twonon-angular modes may include a DC mode and a planar mode.

The number of intra-prediction modes may differ according to a type ofcolor component. For example, the number of intra-prediction modes maybe varied depending on whether the color component is a luma signal or achroma signal.

The PU may have a square form having an N×N or a 2N×2N size. The N×Nsize may include 4×4, 8×8, 16×16, 32×32, 64×64, 128×128, etc.Alternatively, the PU may have an M×N size. Herein, M and N may be apositive integer more than 2, and M and N may be different numbers. Aunit of PU may be a size of at least one of CU, PU, and TU.

Intra encoding and/or decoding may be performed by using a sample valueincluded in a neighboring reconstructed unit or a coding parameter.

In intra prediction, a prediction block may be generated by applying areference sample filter to a reference pixel through using at least oneof sizes of encoding/decoding target blocks. Types of the referencefilter applied to the reference pixel may differ. For example, thereference filter may differ according to the intra-prediction mode of anencoding/decoding target block, a size/form of encoding/decoding targetblock, or a position of the reference pixel. “Types of the referencefilter may differ” may refer to a filter coefficient of the referencefilter, a number of filter taps, and filter intensity, or a number offiltering process may be differed.

In order to perform intra prediction, an intra-prediction mode of acurrent prediction unit may be predicted by an intra-prediction mode ofa neighboring prediction unit that is adjacent to the current predictionunit. When the intra-prediction mode of the current prediction unit ispredicted by using intra-prediction mode information of the neighboringprediction unit, and the both of the modes are identical, informationthat both of modes are identical may be transmitted by using apredetermined flag. Alternatively, when the modes are different, allprediction mode information within encoding/decoding target block may beencoded by entropy encoding.

FIG. 7 is a diagram showing an example of an inter-prediction process.

A rectangle of FIG. 7 may refer to an image (or picture). In addition,arrows of FIG. 7 may indicate a prediction direction. In other words,the image may be encoded and/or decoded according to the arrowdirections. Each image may be classified into an I-picture (Intrapicture), a P-picture (Uni-predictive Picture), and a B-picture(Bi-predictive Picture), etc. according to an encoding type. Eachpicture may be encoded and decoded according to an encoding type of eachpicture.

When an encoding target image is an I-picture, the target image itselfmay be intra-encoded while inter prediction is performed. When anencoding target image is a P-picture, the target image may be encoded byinter prediction using a reference image in a forward direction, ormotion compensation. When an encoding target image is a B-picture, thetarget image may be encoded by inter prediction using reference picturesin a forward direction and in a reverse direction, or motioncompensation. Alternatively, the target image may be encoded by interprediction using a reference image in forward direction or in a reversedirection. Herein, in case of the inter-prediction mode, the encoder mayperform inter prediction or the motion compensation, and the decoder mayperform motion compensation in response to the encoder. Images of aP-picture and B-picture that are encoded and/or decoded by using areference image are used for inter prediction.

Hereinbelow, inter prediction according to an embodiment is described indetail.

Inter prediction or motion compensation may be performed by using areference image and motion information. In addition, inter predictionmay use the skip mode described above.

The reference picture may be at least one of a previous picture of acurrent picture or a subsequent picture of the current picture. Herein,in inter prediction, a block of the current picture based on thereference picture may be predicted. Herein, an area within the referencepicture may be specified by using a reference picture index refIdxindicating the reference picture and a motion vector that will bedescribed later.

In inter prediction, a reference block that corresponds to the currentblock within the reference picture may be selected. A prediction blockof the current block may be generated by using the selected referenceblock. The current block may be a current encoding or decoding targetblock among blocks of the current picture.

Motion information may be derived from an inter-prediction process ofthe encoding apparatus 100 and the decoding apparatus 200. In addition,the derived motion information may be used for inter prediction. Herein,the encoding apparatus 100 and the decoding apparatus 200 may improveefficiency of encoding and/or decoding by using motion information of areconstructed neighboring block and/or motion information of acollocated block (col block). The collocated block may be a block thatspatially corresponds to an encoding/decoding target block within areconstructed collocated picture (col picture). The reconstructedneighboring block may be a block within the current picture and areconstructed block through encoding and/or decoding. In addition, thereconstructed block may be a block adjacent to the encoding/decodingtarget block and/or a block positioned at an outer corner of theencoding/decoding target block. Herein, the block positioned at theouter corner of the encoding/decoding target block may be a block thatis adjacent in a vertical direction, and the block adjacent in avertical direction is adjacent to the encoding/decoding target block ina horizontal direction. Alternatively, the block positioned at the outercorner of the encoding/decoding target block may be a block that isadjacent in a horizontal direction, and the block adjacent in ahorizontal direction is adjacent to the encoding/decoding target blockin a vertical direction.

Each of the encoding apparatus 100 and the decoding apparatus 200 maydetermine a predetermined relative position based on a block that ispresent at a position spatially corresponding to the current blockwithin the collocated picture. The predetermined relative position maybe positioned at an inside and/or outside of the block that is presentat the position spatially corresponding to the current block. Inaddition, the encoding apparatus 100 and the decoding apparatus 200 mayderive the collocated block based on the determined relative position.Herein, the collocated picture may be at least one picture amongreference pictures included in a reference picture list.

A method of deriving the motion information may vary according to aprediction mode of the encoding/decoding target block. For example, theprediction mode applied for inter prediction may include an advancedmotion vector predictor (AMVP) mode, a merge mode, and the like. Herein,the merge mode may refer to a motion merge mode.

For example, in the case of applying the advanced motion vectorpredictor (AMVP) mode, the encoding apparatus 100 and the decodingapparatus 200 may generate a prediction motion vector candidate list byusing a motion vector of the restored neighboring block and/or a motionvector of the collocated block. In other words, the motion vector of therestored neighboring block and/or the motion vector of the collocatedblock may be used as a prediction motion vector candidate. Herein, themotion vector of the collocated block may refer to a temporal motionvector candidate, and the motion vector of the restored neighboringblock may refer to a spatial motion vector candidate.

The encoding apparatus 100 may generate a bitstream, and the bitstreammay include a motion vector candidate index. In other words, theencoding apparatus 100 may entropy encode the motion vector candidateindex to generate the bit stream. The motion vector candidate index mayindicate an optimal prediction motion vector selected among theprediction motion vector candidates included in the motion vectorcandidate list. The motion vector candidate index may be transmittedfrom the encoding apparatus 100 to the decoding apparatus 200 throughthe bitstream.

The decoding apparatus 200 may entropy decode the motion vectorcandidate index through the bit stream, and select the motion vectorcandidate of the decoding target block among the motion vectorcandidates included in the motion vector candidate list by using theentropy decoded motion vector candidate index.

The encoding apparatus 100 may calculate a motion vector difference(MVD) between the motion vector of the encoding target block and themotion vector candidate, and may entropy encode the motion vectordifference (MVD). The bitstream may include the entropy encoded MVD. TheMVD is transmitted to the decoding apparatus 200 through the bitstream.Herein, the decoding apparatus 200 may entropy decode the MVD from thebitstream. The decoding apparatus 200 may derive the motion vector ofthe decoding target block through a sum of the decoded MVD and themotion vector candidate.

The bitstream may include a reference picture index indicating thereference picture. The reference picture index may be entropy encodedand transmitted from the encoding apparatus 100 to the decodingapparatus 200 through the bitstream. The decoding apparatus 200 maypredict the motion vector of the current block by using the motioninformation of the neighboring block, and may derive the motion vectorof the decoding target block by using the predicted motion vector and aresidual value of the predicted the motion vector. The decodingapparatus 200 may generate the prediction block of the decoding targetblock based on the derived motion vector and the reference picture indexinformation.

As another method of deriving the motion information, a merge mode maybe used. The merge mode may refer to a motion merging of a plurality ofblocks. The merge mode may also refer to applying motion information ofa single block to another block. When the merge mode is applied, theencoding apparatus 100 and the decoding apparatus 200 may generate amerge candidate list by using the motion information of the restoredneighboring block and/or the motion information of the collocated block.Herein, the motion information may include at least one of 1) the motionvector, the reference picture index, and 3) an inter-predictionindicator. The prediction indicator may indicate a uni-direction (L0prediction, L1 prediction), or a bi-direction.

Herein, the merge mode may be applied in a unit of a coding unit or aprediction unit (PU). In the case of performing the merge mode by the CUunit or the PU unit, the encoding apparatus 100 may generate a bitstreamby entropy encoding predetermined information, and transmit thebitstream to the decoding apparatus 200. The bitstream may include thepredetermined information. The predetermined information may include 1)a merge flag representing whether the merge mode is used for each blockpartition, 2) a merge index including information to which block amongthe neighboring blocks adjacent to encoding target block is merged. Forexample, neighboring blocks adjacent to encoding target block mayinclude a left adjacent block of the current block, an upper adjacentblock of the encoding target block, a temporally adjacent block of theencoding target block, and the like.

The merge candidate list may represent a list in which the motioninformation is stored. The merge candidate list may be generated beforeperforming the merge mode. The motion information stored in the mergecandidate list may be at least one of motion information of theneighboring block adjacent to the encoding/decoding target block, ormotion information of the collocated block corresponding to theencoding/decoding target block in the reference picture, motioninformation newly generated by combining the motion information that ispresent in the merge motion candidate list in advance, and a zero mergecandidate. Herein, the motion information of the neighboring blockadjacent to the encoding/decoding target block may refer to a spatialmerge candidate, and the motion information of the collocated blockcorresponding to the encoding/decoding target block in the referencepicture may refer to a temporal merge candidate.

In the case of a skip mode, the skip mode applies the motion informationof the neighboring block to the encoding/decoding target block. The skipmode may be one of other modes used in inter prediction. When the skipmode is used, the encoding apparatus 100 may generate a bitstream byentropy encoding information of the neighboring block that may be usedfor the encoding target block, and transmit the bit stream to thedecoding apparatus 200. The encoding apparatus 100 may not transmitother information such as syntax information to the decoding apparatus200. The syntax information may include at least one of residualinformation of the motion vector, an encoding block flag, and atransform coefficient level.

Hereinafter, an encoding/decoding method of an intra-prediction modewill be described with reference to FIGS. 8 to 15 . Hereinafter, theintra-prediction mode is defined as an IPM. In the present invention, asecondary IPM (SIPM: Secondary IPM) and a secondary MPM(SMPM: SecondaryMPM) are used in the same meaning.

FIG. 8 is a flow chart explaining an encoding method of anintra-prediction mode according to an embodiment of the presentinvention.

In step S801, the encoding method may construct a first candidate modeset. The first candidate mode set may include M (M is an integer equalto or greater than 1) candidate modes. The encoding method may performthe construction of the first candidate mode set based on an availableintra-prediction mode of an upper and/or a left block adjacent to acurrent block.

In step S802, the encoding method may determine whether or not anintra-prediction mode of the current block is included in the firstcandidate mode set.

In step S806, when the intra-prediction mode of the current block isdetermined to be included in the first candidate mode set in step S802,the encoding method encodes the intra-prediction mode of the currentblock. Herein, the encoding method may encode information on the firstdetermination result indicating that the intra-prediction mode of thecurrent block is included in the first candidate mode set, and firstindication information for indicating the same candidate mode as theintra-prediction mode of the current block among the M candidate modesincluded in the first candidate mode set.

The first candidate mode set including the M candidate modes maycorrespond to an MPM candidate mode set that will be described later. Inaddition, the information on the first determination result and thefirst indication information may respectively correspond to an MPM flagand an MPM index that will be described later.

When the intra-prediction mode of the current block is determined not tobe included in the first candidate mode set in step S802, the encodingmethod may move to step S803.

In step S803, the encoding method may construct a second candidate modeset including N (N is an integer equal to or greater than 1) candidatemodes. The encoding method may perform the construction of the secondcandidate mode set based on at least one reference prediction mode thatis selected from the candidate modes included in the first candidatemode set.

In step S804, the encoding method may determine whether or not theintra-prediction mode of the current block is included in the secondcandidate mode set.

In step S806, when the intra-prediction mode of the current block isdetermined to be included in the second candidate mode set in step S804,the encoding method may encode information on the second determinationresult indicating that the intra-prediction mode of the current block isincluded in the second candidate mode set and second indicationinformation for indicating the same candidate mode as theintra-prediction mode of the current block among the N candidate modesincluded in the second candidate mode set. Alternatively, the encodingmethod may encode the information on the first determination resulttogether.

The second candidate mode set including the N candidate modes maycorrespond to a second IPM candidate (candidate mode set) that will bedescribed later. In addition, the information on the seconddetermination result and the second indication information mayrespectively correspond to a second MPM flag (secondary MPM flag) and asecond MPM index (secondary MPM index) that will be described later.

When the intra-prediction mode of the current block is determined not tobe included in the second candidate mode set in step S804, the encodingmethod may move to step S805.

In step S805, the encoding method may construct a remaining candidatemode set including remaining modes that are not included in both thefirst and second candidate mode sets. Herein, in step S806, the encodingmethod may encode information indicating that the intra-prediction modeof the current block is not included in both the first and secondcandidate mode sets, and third indication information indicating thesame candidate mode as the intra-prediction mode of the current blockamong the intra prediction modes included in the remaining candidatemode set. The information indicating that the intra-prediction mode ofthe current block is not included in both the first and second candidatemode sets may be encoded by using the information on the firstdetermination result and the information on the second determinationresult.

The third indication information may correspond to an IPM index(rem_intra_luma_pred_mode) that will be described later.

When encoding the IMP of the current block, the encoding method mayperform at least one additional decision step besides the steps S802and/or S804. The encoding method may perform the additional decisionstep in an arbitrary order between the steps S801 to S806. The encodingmethod may perform the additional decision step based on at least one ofthe IPM of the current block, IPM(s) of neighboring block(s), a samplevalue of the current block, sample value(s) of the neighboring block(s),statistics of the IPMs of neighboring blocks such as distribution, anaverage value, a median value, a distribution value, a norm value, etc.,a variation amount of the sample value of the current block and/or theneighboring blocks, IPM value(s) included in the first candidate modeset, and IPM value(s) included in the second candidate mode set.Alternatively, the encoding method may determine whether or not the IPMof the current block is included in an n-th candidate mode set in theadditional decision step when 3 or more candidate mode sets areprovided. When 3 or more candidate mode sets are provided, the encodingmethod shown in FIG. 8 may include construct the n-th candidate modeset. Herein, n is an integer equal to or greater than 3.

FIG. 9 is a flow chart explaining a decoding method of anintra-prediction mode according to an embodiment of the presentinvention.

In step S901, the decoding method may decode candidate mode setselecting information and candidate mode selecting information. Thecandidate mode set selecting information may include first candidatemode set selecting information and/or second candidate mode setselecting information. The candidate mode set selecting information maycorrespond to the information on the first determination result and/orthe information on the second determination result explained withreference to FIG. 8 . The candidate mode set selecting information maybe decoded from a single syntax element or from multiple syntaxelements. Descriptions of the first candidate mode set and the secondcandidate mode set may be the same as described with reference to FIG. 8. The candidate mode selecting information may be information forselecting one mode among the candidate modes included in the candidatemode set. The candidate mode selecting information may correspond to thefirst, second, and/or third indication information explained withreference to FIG. 8 . The candidate mode selecting information may be anindex indicating one candidate mode among the candidate modes includedin the candidate mode set. Alternatively, the candidate mode selectinginformation may be information directly indicating an intra-predictionmode of a current block.

In step S902, the decoding method may determine whether or not thecandidate mode set selecting information indicates the first candidatemode set. When the candidate mode set selecting information indicatesthe first candidate mode set (YES), the first candidate mode set may beused for decoding the intra-prediction mode of the current block.

In step S904, when the candidate mode set selecting informationindicates the first candidate mode set, the decoding method may derivethe intra-prediction mode of the current block from the first candidatemode set based on the candidate mode selecting information.

In step S903, when the candidate mode set selecting information does notindicate the first candidate mode set (NO) in step S902, the decodingmethod may determine whether or not the candidate mode set selectinginformation indicates the second candidate mode set. When the candidatemode set selecting information indicates the second candidate mode set(YES), the second candidate mode set may be used for decoding theintra-prediction mode of the current block.

In step S905, when the candidate mode set selecting informationindicates the second candidate mode set, the decoding method may derivethe intra-prediction mode of the current block from the second candidatemode set based on the candidate mode selecting information

When the candidate mode set selecting information does not indicate thesecond candidate mode set (NO) in step S903, a remaining candidate modeset that is not included in both the first and second candidate modesets may be used for decoding the intra-prediction mode of the currentblock.

In step S906, when candidate mode set selecting information does notindicate the second candidate mode set (NO) in step S903, the decodingmethod may derive the intra-prediction mode of the current block fromthe remaining candidate mode set based on the candidate mode selectinginformation.

When decoding the IPM of the current block, the decoding method mayperform at least one additional decision step besides the steps S902and/or S903. The decoding method may perform the additional decisionstep in an arbitrary order between the steps S901 to S904 or between thesteps S905 or S906. The decoding method may perform the additionaldecision step based on at least one of the IPM of the current block,IPM(s) of neighboring block(s), a sample value of the current block,sample value(s) of the neighboring block(s), statistics of the IPMs ofneighboring blocks such as distribution, an average value, a medianvalue, a distribution value, a norm value, etc., a variation amount ofthe sample value of the current block and/or the neighboring blocks, IPMvalue(s) included in the first candidate mode set, and IPM value(s)included in the second candidate mode set. Alternatively, the decodingmethod may determine whether or not the IPM of the current block isincluded in an n-th candidate mode set in the additional decision stepwhen 3 or more candidate mode sets are provided. When 3 or morecandidate mode sets are provided, the decoding method shown in FIG. 9may include constructing the n-th candidate mode set. Herein, n is aninteger equal to or greater than 3.

An encoding/decoding method of an intra-prediction mode according to thepresent invention is described in detail.

The encoding/decoding method of the intra-prediction mode may beperformed by using at least one of a method based on an MPM that will bedescribed later, a method based on a secondary IPM (SIPM: SecondaryIPM), and a method based on a remaining intra-prediction mode except forthe MPM and/or the SIPM. However, it is not limited to the secondaryIPM, a third or more MPM candidate mode set may be used by considering atotal number of predefined intra-prediction modes in theencoder/decoder, a range of an intra-prediction modes which can be usedby an encoding/decoding target block, etc.

1. The encoding/decoding method of the intra-prediction mode based onthe MPM.

A. Up to T (T is a positive integer greater than 0) intra-predictionmodes may be supported for intra prediction. Herein, T may be an integermore than 35 (for example, 67). Hereinafter, for convenience ofexplanation, T is assumed to be 35. The intra-prediction mode usinggreater than 35 intra-prediction modes may be similarly or identicallyencoded/decoded by the method that will be described below. In oneembodiment, two non-angular modes and 33 angular modes may be supportedas depicted in FIG. 10 when up to 35 intra-prediction modes aresupported.

The two non-angular modes may be a planar mode and a DC mode, and IPMindexes thereof may be set to 0 and 1, respectively. The 33 angularmodes are as shown in FIG. 10 , IPM indexes thereof may be set to 2-34,respectively.

B. In order to transmit an intra prediction mode determined at theencoder, an encoding method based on MPM(Most probable mode) derivedfrom an neighboring intra-prediction block that is previouslyencoded/decoded may be used first.

(1) Prediction modes of neighboring intra-prediction blocks are obtainedas MPM candidates. The neighboring intra-prediction blocks may includeat least one of a left block, an upper block, or a corner block of acurrent block. When obtaining the left intra-prediction block and/or theupper intra-prediction block based on the current block, theintra-prediction mode of the block with the highest occurrence frequencyamong the neighboring intra-prediction blocks based on a size of thecurrent block may be obtained, or the intra-prediction mode of the blockthat is placed just to the left part and upper part based on the currentblock may be obtained.

(2) When the intra-prediction modes obtained from the left part and theupper part based on the current block are different, the MPM candidatesmay be constructed up M (M<T, M is a positive integer greater than 0)candidates. In one embodiment, when M is 3, indexes of the MPMcandidates may be assigned as follows.

MPM[0]=Left_IPM,MPM[1]=Above_IPM,MPM[2]=Planar/DC/Vertical

(Herein, in case of MPM[2], MPM[0] or MPM[1] may be same as Planar, DCand Vertical. Therefore, after determining whether to duplicate, anotherIPM may be assigned to MPM[2] according to a predetermined order(Planar->DC->Vertical).)

(3) When the intra-prediction modes obtained from the left part and theupper part based on the current block are identical,

When the two identical modes are planar modes or DC modes, indexes ofthe MPM candidates may be set as follows. MPM[0]=Planar, MPM[1]=DC,MPM[2]=Vertical. Alternatively, when the two identical modes are angularmodes (IPM=2-34), indexes of the MPM candidates may be set as follows.MPM[0]=Left_IPM, MPM[1]=Left_IPM−1, MPM[2]=Left_IPM+1.

(4) In case of the MPM[2] of (2) and (3), except for the aboveembodiment, the MPM[2] may be assigned to an arbitrary intra-predictionmode different an intra prediction mode obtained from a neighboringblock.

C. When binarizing the up to T intra-prediction modes, at least oneentropy encoding method among various entropy encoding methods may beused for encoding the corresponding information.

In one embodiment, when encoding IPM information including 35intra-prediction modes by using fixed length coding (FLC), up to 6 bitsare required to binarize the IPM. However, minimum 3 bits or maximum 6bits are encoded by encoding based on an MPM that uses an IPMcorrelation of neighboring blocks. Herein, when a number of MPMs is M, Mmay be equal to or less than T. When M is set to 3,

-   -   (1) When the current IPM matches to one of the three candidate        modes included in the MPM, the IPM may be binarized by using 3        bits. (Flag information (MPM flag, 1 bit) indicating that the        current IPM of a current encoding unit matches to one of the        three candidate modes included in the MPM, and index information        (MPM index, 2 bit) indicating one mode among the three candidate        modes.)    -   (2) When the current IPM does not match to any one of the three        candidate modes included in the MPM, the IPM may be binarized by        using 6 bits. (Flag information (MPM flag, 1 bit) indicating        that the current IPM of the current encoding unit does not match        to any one of the three candidate modes included in the MPM and        index information (MPM index, 5 bit) indicating the IPM of the        current encoding unit among the remaining 32 IPMs excluding the        three MPM modes out of a total of 35 IPM modes.)    -   (3) When the MPM is actually selected according to the above        embodiment method, a number of bits may be reduced when encoding        using an FLC code word since the candidate mode of the MPM is        binarized by 3 bits instead of 6 bits    -   (4) The above embodiments follow binarization steps while        encoding using FLC code word. The IPM may be binarized by using        at least one of various entropy encoding methods used in video        standards.

D. The flag and index information described above may use at least oneof the following entropy encoding methods. After being binarized, theflag and index information may be finally encoded in CABAC(ae(v)).

-   -   a truncated rice binarization method    -   a K-th order Exp_Golomb binarization method    -   a restricted K-th order Exp_Golomb binarization method    -   a fixed-length binarization method    -   a unary binarization method    -   a truncated unary binarization method

A decoder may construct M (for example, 3, 4, 5, 6, etc.) MPM candidatemodes by obtaining neighboring IPM values similarly as the encoder does.

When the IPM of the current block is identical to at least one of theMPM candidate modes according to a decoded value of the MPM flagdescribed above, the decoder may obtain an IPM value necessary forcurrent decoding among the MPM candidate modes by using the MPM index.

When the IPM of the current block is not identical to any one of the MPMcandidate modes according to the decoded value of the MPM flag describedabove, the decoder may obtain the IPM value necessary for currentdecoding among the MPM candidate modes by using the IPM index.

In one embodiment, when the total number of the intra-prediction modesare 35 and the number of the MPM candidates modes are 3, and when theIPM of the current block is not included in the MPM candidate modes, anIPM index value has a value range from 0˜31. However, the IPM indexvalue needs to be revised since the IPM index value is not an actual IPMvalue of a current decoding unit. For example, when 3 MPM candidatemodes actually have angular modes 3, 25, and 28 and the IPM of thecurrent decoding block has a mode 17, the IPM index (0-31) may beconstructed as the following table that does not include the 3 MPMcandidate modes, and the encoder may transmit by entropy encoding theIPM index that corresponds to mode 16.

As shown in table 1, the decoder may construct a revised IPM table(Revised(Rev.) IPM Table) in which the actual IPM value that matches tothe IPM index is reflected. Therefore, the decoder may derive the IPMvalue (17) of the currently decoded intra-prediction block by using thetable 1. Herein, the decoder may not construct the table when decoding,but obtain the IPM index value (16) and sorting corresponding MPMcandidate values (3, 25, and 28) in ascending order, and obtain the IPMvalue of the current block by increasing by 1 when the current decodedIPM index value is greater than the MPM candidate value. Therefore,since the current IPM index value that is 16 is larger that only one (3)of the three MPM candidates, an original IPM value that is 17 may beobtained by increasing the current IPM index value by 1 (16+1=17).

TABLE 1 IPM Mode Rev. IPM mode IPM index  0  0  0  1  1  1  2  2  2  3(MPM candidate)  4  3  4  5  4 — — — — — — 16 17 16 (transmitted indexvalue) 17 (Actual IPM) 18 17 — — — — — — 24 26 24 25(MPM candidate) 2725 26 29 26 27 30 27 28(MPM candidate) 31 28 29 32 29 30 33 30 31 34 3132 — — 33 — — 34 — —

2. The encoding/decoding method of the intra-prediction mode based onthe secondary IPM.

[Step 1] An encoder may encode by using a secondary MPM by generating asecondary intra-prediction candidate mode list including N candidatemodes when an intra-prediction mode of a current encoding intra block isnot identical to any one of M candidate modes of an MPM.

Herein, the generated N secondary IPM candidate modes include anotherprediction mode different from M MPM candidate modes.

The encoder and decoder may have same number of generated N secondaryIPM candidate modes. The number N may be an arbitrary positive integerand may be set to be equal to or smaller than a total number of theintra-prediction modes-M.

In one embodiment, the number of N secondary IPM candidate modes may be4. When an intra-prediction mode of a current encoding intra-predictionmode is identical to one of the secondary IPM candidate modes, and thecurrent encoding intra-prediction mode is binarized by FLC codeword, thecurrent encoding intra-prediction mode may be expressed as 4 bits. (MPMflag(1 bit, “0”)+Secondary MPM flag(1 bit, “1”)+SMPM index(2 bits)).

In one embodiment, the number of N secondary IPM candidate modes may be16. When the intra-prediction mode of the current encodingintra-prediction mode is identical to one of the secondary candidatemodes, and the current encoding intra-prediction mode is binarized byFLC codeword, the current encoding intra-prediction mode may beexpressed as 6 bits. (MPM flag(1 bit, “0”)+Secondary MPM flag(1 bit,“1”)+SMPM index(4 bit)).

The number of candidate modes and which candidate modes to be includedin the secondary IPM candidate modes may be determined according tovarious encoding parameters (for example, pre-defined intra-predictionrelated syntax, encoding parameter, size of current encoding unit,prediction unit and transform unit, information whether or not theencoding unit is partitioned, M MPM candidate modes and anintra-prediction mode of neighboring block that is not included in MPM).

The number of the secondary IPM candidate modes and whether or not thesecondary IPM candidate mode is used may be entropy encoded/decoded inat least one of a video parameter set, a sequence parameter set, apicture parameter set, an adaptation parameter set, a slice header, acoding unit, a prediction unit, and a transform unit, or may beimplicitly set in the encoder/decoder according to the same method.Alternatively, while entropy encoding/decoding the

-   -   at least one of the above information, at least one of the        following binarization methods may be used:    -   a truncated rice binarization method    -   a K-th order Exp_Golomb binarization method    -   a restricted K-th order Exp_Golomb binarization method    -   a fixed-length binarization method    -   a unary binarization method    -   a truncated unary binarization method

The above method is not limited to using the secondary IPM candidatemodes besides the MPM, and flag information and intra-prediction modeinformation may be encoded/decoded according to the above method byforming a third or more IPM candidate mode group.

The secondary IPM candidate modes may be constructed according tovarious methods that will be described below. The encoder may determinean arbitrary secondary IPM candidate mode based on the following variousmethods. The decoder may derive the secondary IPM candidate modesaccording to the predefined rule as the encoder does.

When the number of the secondary IPM candidate modes is N, within theallowed number, intra-prediction modes other than the existing MPMcandidate modes may be included in the secondary IPM candidate modes.The secondary IPM candidate modes may be obtained by sub-sampling Ncandidate modes from the entire intra-prediction modes except for theMPM candidate modes. Herein, for the N secondary IPM candidate modes,corresponding index values from 0 to N−1 which are not the uniqueintra-prediction mode values may be encoded.

(1) The secondary IPM candidate modes may be constructed including amode having a high occurrence frequency of being selected as theintra-prediction mode.

In general, intra-prediction modes of a planar mode, DC mode, verticalmode, horizontal mode, diagonal angular mode may be included in thesecondary IPM candidate modes since they have a high probability to beselected when a current block is homogeneous or an edge component of thecurrent block for the diagonal angle is strong.

For example, when 35 intra-prediction modes are supported, in FIG. 11 ,intra-prediction indexes for vertical, horizontal, diagonal angularmodes may correspond to 26, 10, 18, and 34, respectively. When 67intra-prediction modes are supported, intra-prediction indexes forvertical, horizontal, diagonal angular modes may correspond to 50, 18,34, and 66, respectively. Herein, intra-prediction indexes for a planarmode and DC mode may correspond to 0, and 1, respectively in common.

(2) When the M candidate modes included in the MPM are constructed withat least one angular mode except for the planar mode and the DC mode,the secondary IPM candidate modes may be constructed by usingneighboring modes of the corresponding angular modes.

In one embodiment, when one angular mode is included in the M MPMcandidate modes and an index of the angular mode is K, the secondary IPMcandidate modes may be constructed including up to N candidate modessuch as K−1, K+1, K−2, K+2, . . . .

In one embodiment, when two angular modes L and A are included in the MMPM candidate modes, as described above, the secondary IPM candidatemodes may be constructed including L−1, L+1, L−2, L+2 . . . and A−1,A+1, A−2, A+2, . . . . Alternatively, the secondary IPM candidate modesmay be constructed including up to N candidate modes that are modescorresponding to a maximum value (Max), a minimum value (Min), anaverage value (Avg), a median value (Median) of the two angular modesand/or neighboring modes of the above derived modes such as Max−1,Max+1, Max−2, Max+2 . . . or Min−1, Min+1, Min−2, Min+2, . . . or Avg−1,Avg+1, Avg−2, Avg+2, . . . .

In one embodiment, when S number of different angular modes are includedin the M MPM candidate modes, herein S<=M, the secondary IPM candidatemodes may be constructed including neighboring modes of each angularmode or intra-prediction modes corresponding to a maximum value, aminimum value, an average value, a median value of the angular modes.Herein, orders constructing the secondary IPM candidate modes may bemade freely; however, the encoder/decoder may follow the same order, andthe number of the secondary IPM candidate modes cannot exceed N.

As described above, when deriving neighboring modes by using angularmode information of the MPM candidate modes, each has to have adifferent intra-prediction mode. For example, when Max−1 and Min+1 areidentical modes, then only one of the two may be included in thesecondary IPM candidate modes. Intra-prediction modes constructedincluding values calculated by adding/subtracting (for example, Min−1,Min+1, Max+1, Max+2, etc.) may be replaced to another mode when thecalculated values exceed an intra-prediction mode index range. (In FIG.11 , when 67 intra-prediction modes are supported and Max+2 is greaterthan 66, an intra-prediction mode 2 or an intra-prediction mode morethan 2 may be included in the secondary IPM candidate modes.)

(3) The secondary IPM candidate modes may include up to N candidatemodes according to intra-prediction modes that have high occurrencefrequency by deriving statistics of actual intra prediction modesencoded in a previously encoded picture or slice.

(4) The secondary IPM candidate modes may be derived by sub-sampling upto N candidate modes from the intra-prediction modes except for theintra-prediction modes included in the MPM candidate modes according toMPM construction information (for example, information on intraprediction mode included in MPM(angular mode), information about whetheror not an identical intra-prediction mode occurs, distribution ofintra-prediction mode indexes included in the MPM, error between aprediction block according to an angle and a reconstructed neighboringreference sample, etc.)

In one embodiment, when 67 intra-prediction modes (planar mode, DC modeand 65 angular modes) are supported for intra prediction, 6 MPM modesand 16 secondary IPM candidate modes may be constructed according to thefollowing criteria. Herein, distribution of intra-prediction modes ofthe MPM within the entire intra-prediction modes may be as shown in FIG.12 . In the above criteria, L and A may be obtained fromintra-prediction modes that have the highest occurrence frequency in aleft block and an upper block based on a current block and are alreadyencoded. Max and Min represent a maximum value and a minimum value of Land A as described above.

The left-most column of FIG. 12 corresponds to values indicatingintra-prediction modes. Angular modes (2-66) among the intra-predictionmodes are represented in a light gray color, and non-angular modes 0(planar mode) and 1 (DC mode) are represented in a white color.

The second column to the last column of FIG. 12 correspond to variouscases (Case 1˜Case 6) that select the MPM candidate mode based on L andA. According to each column, the selected MPM candidate mode isrepresented in a light gray color.

The first case (Case 1) of FIG. 12 is L=A (represented in C); however,the corresponding modes are neither planar modes nor DC modes. Herein, 6MPM candidate modes may include C, planar, C+1, C−1, C+2, and DC modes.

The second case (Case 2) of FIG. 12 is L=A (represented in C); however,the corresponding modes are planar modes or DC modes. Herein, 6 MPMcandidate modes may include planar, DC, vertical (50), horizontal (18),2, and 34 modes.

The third case (Case 3) of FIG. 12 is L!=A; however, neither of thecorresponding modes is a planar mode, but one of the two is a DC mode.Herein, 6 MPM candidate modes may include L, A, Planar, Max−1, Max+1,and Max+2 modes.

The fourth case (Case 4) of FIG. 12 is L!=A; however, neither of thecorresponding modes is a planar mode or DC modes. Herein, 6 MPMcandidate modes may include L, A, Planar, DC, Max+1, and Min−1 modes.

The fifth case (Case 5) of FIG. 12 is L!=A, one of the correspondingmodes is a planar mode and the other is a DC mode. Herein, 6 MPMcandidate modes may include L, A, vertical (50), horizontal (18), 2, and34 modes.

The sixth case (Case 6) of FIG. 12 is L!=A, one of the correspondingmodes is a planar mode and the other is not a DC mode. Herein, 6 MPMcandidate modes may include L, A, DC, Max−1, Max+1, and Max+2 modes.

The sub-sampling for constructing the secondary IPM candidate modes maybe performed using at least intra-prediction mode included in the MPMcandidate modes as a reference prediction mode. Herein the referenceprediction mode may be a predetermined positional angular mode among theintra-prediction mode included in the MPM. Alternatively, it may be oneor more angular modes among the intra-prediction mode included in theMPM. At least one of a minimum value, a maximum value, an average value,a median value of angular modes or an intra-prediction mode derived fromneighboring prediction blocks (L or A) may be set to the referenceprediction mode. Alternatively, the sub-sampling may be performed bysetting at least one of the intra-prediction modes except for the MPMcandidate modes as the reference prediction mode. In one embodiment, aminimum value among the remaining intra-prediction modes may be set asthe reference prediction mode.

FIG. 13 is a diagram explaining various embodiments constructing thesecondary IPM candidate modes based on the construction of the MPMcandidate modes according to the first case of FIG. 12 .

In FIG. 13 , 0-66 are indexes of 67 intra-prediction modes. Herein, 0and 1 may represent a planar mode and a DC mode. The secondary IPMcandidate modes are set to 16 candidate modes. In addition, according tothe first case of FIG. 12 , the MPM candidate modes are represented in alight gray color. In addition, modes that are selected as the secondaryIPM candidate modes are represented in a dark gray color.

In the first case of FIG. 12 , an intra-prediction mode derived from theleft and upper part has a single angular mode (C), and in order toconstruct the MPM candidate modes having M modes (6 modes in the presentembodiment), planar, C+1, C−1, C+2, DC modes are added to the MPMcandidate modes. Herein, a reference prediction mode of the sub-samplingto construct N secondary IPM candidate modes may be the angular mode C.In other words, the N secondary IPM candidate modes may be sub-sampledaccording to following various embodiments based on C−1 and C+2.

In one embodiment, in order to construct 16 secondary IPM candidatemodes except for the 6 MPM candidate modes, the same number (N/2) ofintra-prediction modes that are smaller than C−1 and intra-predictionmodes that are greater than C+1 may be selected, or may be selected indifferent numbers. In addition, while performing sub-sampling, an indexinterval may be set to 2 as shown in FIGS. 13 (1) and 13(2).Alternatively, the index interval may be set to 1 as shown in FIG. 13(3). Alternatively, the secondary IPM candidate modes may be constructedwith a bigger interval.

In one embodiment, a part of the secondary IPM candidate modes may beconstructed by using the above method, and a part of the remainingsecondary IPM candidate modes may be constructed with intra-predictionmodes adjacent to a planar mode and a DC mode. FIGS. 13 (4) and 13(5)are examples in which 4 intra-prediction modes that are adjacent to theplanar and DC modes and the rest 12 intra-prediction modes that areadjacent to the angular modes are used to construct the secondary IPMcandidate modes. Herein, in configurations shown in FIGS. 13 (4) and13(5), index intervals of intra prediction modes neighboring the planarmode and the DC mode may be set to 1, 2, or more as described above.

The N secondary IPM candidate modes may be constructed with predictionmode values that are different from each other. When prediction modevalues are saturated, the corresponding value may be replaced withanother value. For example, when an intra-prediction mode having anarbitrary value greater than C+2 in FIG. 13 (1) is obtained as thesecondary IPM candidate mode and the arbitrary value exceeds 66, thenthe arbitrary value may be changed in another intra-prediction modehaving a smaller value than 66, or may be changed in an intra-predictionmode with a value bigger than 2. Alternatively, when an intra-predictionmode having an arbitrary value smaller than C−1 is obtained as thesecondary IPM candidate mode and the arbitrary value is smaller than 2,the intra-prediction mode may be changed to an intra-prediction modewith a value of 2 or bigger than 2, or with a value smaller than 66.

Distributions of MPM candidate modes of Case 3 and Case 6 shown in FIG.12 are identical to that of Case 1. Therefore, the N secondary IPMcandidate modes may be constructed by using the method described above.

When an intra-prediction mode of a current encoding block is identicalto one of the N secondary IPM candidate modes, the N secondary IPMcandidate modes may be indexed as 0, 1, 2, . . . , N−1, and the indexvalue of the N secondary IPM candidate modes indicating the same intraprediction mode value as the current intra-prediction mode may betransmitted.

In one embodiment, while defining indexes for the N secondary IPMcandidate modes in FIG. 13 , the secondary IPM candidate mode that issmaller than C−1 or greater than C+2 may be indexed in turn from 0 toN−1.

In one embodiment, while defining indexes for the N secondary IPMcandidate modes selected in FIG. 13 , the N secondary IPM candidatemodes may be indexed from 0 to N−1 according to an ascending order or adescending order based on unique values of intra-prediction modesaccording to an angle.

In one embodiment, while defining indexes for the N secondary IPMcandidate modes selected in FIG. 13 , the secondary IPM candidate modesselected in neighbors of planar/DC modes are indexed first and theremaining secondary IPM candidate modes may be indexed in an arbitraryorder.

In addition to the above embodiment, the secondary IPM candidate modesmay be indexed from 0 to N−1 according to encoding parameter informationor a method that is identically derived in the encoder/decoder.

FIG. 14 is a diagram explaining an example of constructing the Nsecondary IPM candidate modes based on Case 2 or Case 5 of FIG. 12 . InFIG. 14 , modes represented in a light gray color correspond to modesthat are determined as MPM candidate modes, and modes represented in adark gray color correspond to the secondary IPM candidate modes.

In the Case 2 and Case 5 of FIG. 12 , intra-prediction modes derivedfrom a neighbor are planar and DC modes. Herein, since there is noangular information, vertical (50), horizontal (18), and diagonal (2,and 34) modes are included in the MPM candidate modes based on 67intra-prediction mode indexes.

Herein, in order to construct the N secondary IPM candidate modes,intra-prediction mode values that are adjacent to the pre-selected MPMintra-prediction modes may be selected.

In one embodiment, in order to construct 16 secondary IPM candidatemodes, as the Case 1, the 16 secondary IPM candidate modes may includeintra-prediction modes having the same numbers or having differentnumbers around the MPM candidate modes, or may be sub-sampled byapplying an arbitrary index interval (1 or 2). Herein, the sub-samplingmethod for constructing the secondary IPM candidate modes may beperformed by using various methods as in the Case 1 described above. Inthis case, the entire prediction modes shall be different from eachother and the maximum number shall not exceed the number N.

When an intra-prediction mode of a current encoding block is identicalto one of the secondary MPM candidate modes, the N secondary MPMcandidate modes may be indexed as 0, 1, 2, . . . , N−1 as describedabove.

FIG. 15 is a diagram explaining an example of constructing the Nsecondary IPM candidate modes based on Case 4 of FIG. 12 . In FIG. 15 ,modes represented in a light gray color correspond to modes that aredetermined as MPM candidate modes, and modes represented in a dark graycolor correspond to the secondary IPM candidate modes.

In Case 4 shown in FIG. 12 , neighboring intra-prediction modes (L, A)are angular modes that are different from each other, and thus the Nsecondary IPM candidate modes may be constructed with neighboringintra-prediction modes that are adjacent to the corresponding angularmodes.

Herein, in order to construct the N secondary IPM candidate modes,intra-prediction modes that are adjacent to the pre-selected MPM basedprediction modes may be selected.

In one embodiment, in order to construct 16 secondary IPM candidatemodes, intra-prediction modes having the same numbers or havingdifferent numbers around angular prediction modes included in the MPMmay be sub-sampled. Alternatively, as in the Case 1, the entire 16number of the secondary IPM candidate modes may be constructed with apart using neighboring intra-prediction modes of two differentintra-prediction modes, and the other part using intra-prediction modesneighboring a planar mode or a DC mode.

When the intra-prediction mode of the current encoding block isidentical to one of the secondary MPM candidate modes, the N secondaryMPM candidate modes may be indexed as 0, 1, 2, . . . , N−1 as describedabove.

The N secondary IPM candidate modes may be sub-sampled according todistribution and features of the MPM as the above embodiments.Alternatively, the N secondary IPM candidate modes may be sub-sampledaccording to an arbitrary index interval by sorting the remainingintra-prediction modes, except for the MPM candidate modes, in anascending order or in a descending order. Herein, the arbitrary indexinterval may be a positive integer equal to or bigger than 1.

In one embodiment, when 67 intra-prediction modes are supported and 6MPM candidate modes are included therein, 61 intra-prediction modes,except for the 6 MPM candidate modes, are sorted in an ascending orderor in a descending order based on unique angular values thereof. The 61sorted intra-prediction modes may respectively have indexes range from 0to 60. The N secondary IPM candidate modes may be constructed accordingto an arbitrary index interval. Herein, the intra-prediction modes maybe identically sorted in an encoder/decoder.

When the intra-prediction modes are sorted as described above and, forexample, the index interval is set to 2, then the N secondary IPMcandidate modes may be constructed with intra prediction modes havingindexes 0, 2, 4, 8, 10, . . . . The intra-prediction mode index finallyencoded may be indexed as 0, 1, 2, . . . N−1, and the correspondinginformation may be encoded.

When the intra-prediction modes are sorted as described above and, forexample, the index interval is set to 4, then the N secondary IPMcandidate modes may be constructed with intra prediction modes havingindexes 0, 4, 8, 16, . . . . The intra-prediction mode index finallyencoded may be indexed as 0, 1, 2, . . . N−1, and the correspondinginformation may be encoded.

[Step 2] When a current intra-prediction mode is identical to one of thesecondary IPM candidate modes, then index thereof (SMPM index) may beencoded.

[Step 3] When the current intra-prediction mode is not identical to anyof the secondary IPM candidate modes, IPM index may be encoded in aexisting way.

The overall pseudo code may be as table 2.

TABLE 2 if (MPM flag ==1) encoding MPM index else{ if (secondary MPMflag ==1) encoding SMPM index else encoding IPM index }

While encoding of the intra-prediction mode using the secondary IPMcandidate mode, information to be transmitted may be entropyencoded/decoded in at least one of a video parameter set, a sequenceparameter set, a picture parameter set, an adaptation parameter set, aslice header, a coding unit, a prediction unit, and a transform unit, ormay be implicitly set in the encoder/decoder according to the samemethod. Alternatively, while entropy encoding/decoding the at least oneinformation of the above information, the information may be encoded byusing one of the following binarization methods.

-   -   a truncated rice binarization method    -   a K-th order Exp_Golomb binarization method    -   a restricted K-th order Exp_Golomb binarization method    -   a fixed-length binarization method    -   a unary binarization method    -   a truncated unary binarization method

A decoding process may be performed as follows according to a series ofprocedures that take place during the encoding process.

In one embodiment, when an MPM flag is “1”, then an intra-predictionmode value may be decoded through a MPM candidate list and an LPK index.

In one embodiment, when the MPM flag is “0” but a Secondary MPM flag is“1”, then the secondary IPM candidate modes may be generated based onthe same criteria set for the encoder/decoder and the intra-predictionmode value may be decode by decoding a SMPM index value.

In one embodiment, when the above two flags are “0”, then theintra-prediction mode value may be decoded through an IPM index. Anintra-prediction mode corresponding to the decoded IPM index may be setas an intra-prediction mode of a current block. Alternatively, theintra-prediction mode of the current block may be derived by adding apredetermined value to the IPM index through a comparison between thedecoded IPM index and a MPM candidate value and/or a SIPM candidatevalue. The predetermined value may be determined based on the number ofMPM candidate value that is equal to or smaller than the decoded IPMindex and/or the number of SIPM candidate values that is equal to orsmaller than the decoded IPM index. For the above comparison, the MPMcandidate value and/or the SIPM candidate value may be sorted in anascending order or in a descending order. In one embodiment, the MPMcandidate value and/or the SIPM candidate value may be sorted in anascending order, and the sorted values may be compared with the decodedIPM index sequentially. When the decoded IPM index is equal to orgreater than the MPM candidate value and/or the SIPM candidate value,the decoded IPM index is increased by 1. Such a process may be repeatedas many times as the number of an MPM candidate value and/or SIPMcandidate values that are equal to or smaller than the decoded IPMindex. When the decoded IPM index is smaller than the MPM candidatevalue and/or a SIPM candidate value, the step of increasing the IPMindex by 1 may be finished.

In the above embodiment, the flag being “1” may represent that thecurrent intra-prediction mode is identical to one of the MPM candidatemodes or the secondary IPM candidate modes. The flag may be expressed as1 or 0. As described above, one of decoding methods of anintra-prediction mode may be selectively used among an intra predictionmode decoding method based on MPM candidate (first method), an intraprediction mode decoding method based on a secondary IPM candidate(second method), and an intra prediction mode decoding method based on aremaining IPM mode (third method) by sequentially signaling the flaginformation. However, it is not limited thereto, and an identifierindicating one of the three methods may be used.

While entropy encoding the at least one information of the aboveinformation, the information may be encoded by using one of thefollowing binarization methods:

-   -   a truncated rice binarization method    -   a K-th order Exp_Golomb binarization method    -   a restricted K-th order Exp_Golomb binarization method    -   a fixed-length binarization method    -   a unary binarization method    -   a truncated unary binarization method

In one embodiment, a SMPM index and an IPM index may be entropy encodedin FLC or in TU. In one embodiment, the SMPM index may be binarized inFLC, and the IPM index may be encoded/decoded in TU. In one embodiment,the SMPM index may be binarized in TU, and the IPM index may beencoded/decoded in FLC. Syntaxes required to apply the present inventionare indicated in the following table 3, and areas including respectivesyntaxes may be changed. For example, the below “log2_secondary_IPM_number_minus2” may be transmitted through SPS or a sliceheader, and at least one of the binarization methods described above maybe used except for entropy encoding defined in table 3.

TABLE 3 Syntax Descriptor Whether or not secondary_IPM_enabled_flag u(1)Secondary IPM is applied Number of used log2_secondary_IPM_number_minus2u(2) Secondary IPM MPM flag prev_intra_luma_pred_flag ae(v) MPM indexmpm_idx ae(v) SMPM flag secondary_intra_luma_pred_flag ae(v) SMPM indexsecondary_mpm_idx ae(v) IPM index rem_intra_luma_pred_mode ae(v)

In the above-described embodiments, the methods are described based onthe flowcharts with a series of steps or units, but the presentinvention is not limited to the order of the steps, and rather, somesteps may be performed simultaneously or in different order with othersteps. In addition, it should be appreciated by one of ordinary skill inthe art that the steps in the flowcharts do not exclude each other andthat other steps may be added to the flowcharts or some of the steps maybe deleted from the flowcharts without influencing the scope of thepresent invention.

What has been described above includes examples of the various aspects.It is, of course, not possible to describe every conceivable combinationof components or methodologies for purposes of describing the variousaspects, but one of ordinary skill in the art may recognize that manyfurther combinations and permutations are possible. Accordingly, thesubject specification is intended to embrace all such alternations,modifications and variations that fall within the spirit and scope ofthe appended claims.

The computer-readable storage medium may include a program instruction,a data file, a data structure, and the like either alone or incombination thereof. The program instruction recorded in thecomputer-readable storage medium may be any program instructionparticularly designed and structured for the present invention or knownto those skilled in the field of computer software. Examples of thecomputer-readable storage medium include magnetic recording media suchas hard disks, floppy disks and magnetic tapes; optical data storagemedia such as CD-ROMs or DVD-ROMs; magneto-optical media such asfloptical disks; and hardware devices, such as read-only memory (ROM),random-access memory (RAM), and flash memory, which are particularlystructured to store and implement the program instruction. Examples ofthe program instruction include not only a mechanical language codeformatted by a compiler but also a high level language code which may beimplemented by a computer using an interpreter. The hardware devices maybe configured to be operated by one or more software modules or viceversa to conduct the processes according to the present invention.

Although the present invention has been described in terms of specificitems such as detailed elements as well as the limited embodiments andthe drawings, they are only provided to help more general understandingof the invention, and the present invention is not limited to the aboveembodiments. It will be appreciated by those skilled in the art to whichthe present invention pertains that various modifications and changesmay be made from the above description.

Therefore, the spirit of the present invention shall not be limited tothe above-described embodiments, and the entire scope of the appendedclaims and their equivalents will fall within the scope and spirit ofthe invention.

INDUSTRIAL APPLICABILITY

The present invention may be used for encoding/decoding an image.

1. An image encoding method performed by an image encoding apparatus, the method comprising: determining, among one or more candidate mode sets, a candidate mode set in which an intra prediction mode of a current block is included; encoding candidate mode set selecting information indicating a candidate mode set of the current block among one or more candidate mode sets, the one or more candidate mode sets comprising a first candidate mode set including one or more candidate modes, a second candidate mode set including one or more candidate modes, and a third candidate mode set including remaining candidate modes; encoding, in response to the candidate mode set of the current block comprises two or more candidate modes, candidate mode selecting information indicating the intra prediction mode of the current block among the two or mode candidate modes; and predicting the current block based on the intra-prediction mode of the current block, wherein a candidate mode included in the second candidate mode set is derived based on a maximum value and a minimum value among an index value of an intra prediction mode of a left block adjacent to the current block and an index value of an intra prediction mode of an upper block adjacent to the current block, in response to the intra prediction mode of the left block and the intra prediction mode of the upper block are not equal to each other, and wherein the second candidate mode set includes a candidate mode, which index value is larger than the maximum value or the minimum value by 2, or smaller than the maximum value or the minimum value by 2, wherein, based on that the intra prediction mode of the left block being not equal to the intra prediction mode of the upper block and one of the intra prediction mode of the left block and the intra prediction mode of the upper block being a DC mode, the second candidate mode set includes a candidate mode, which index value is larger than the maximum value by
 2. 2. The image encoding method of claim 1, wherein, in response to the intra prediction mode of the current block being included in neither the first candidate mode set nor the second candidate mode set, the candidate mode selecting information indicates a candidate mode among candidate modes included in the third candidate mode set.
 3. The image encoding method of claim 1, wherein the second candidate mode set comprises a mode corresponding to the maximum value and a mode corresponding to the minimum value.
 4. An image decoding method performed by an image decoding apparatus, the method comprising: decoding candidate mode set selecting information indicating a candidate mode set of a current block among one or more candidate mode sets, the one or more candidate mode sets comprising a first candidate mode set including one or more candidate modes, a second candidate mode set including one or more candidate modes, and a third candidate mode set including remaining candidate modes; selecting a candidate mode set based on the candidate mode set selecting information; decoding, in response to the selected candidate mode set comprising two or more candidate modes, candidate mode selecting information; selecting, as an intra-prediction mode of a current block, a candidate mode among one or more candidate modes included in the selected candidate mode set based on at least one among the selected candidate mode set and the candidate mode selecting information; and predicting the current block based on the intra-prediction mode of the current block, wherein a candidate mode included in the second candidate mode set is derived based on a maximum value and a minimum value among an index value of an intra prediction mode of a left block adjacent to the current block and an index value of an intra prediction mode of an upper block adjacent to the current block, in response to the intra prediction mode of the left block and the intra prediction mode of the upper block being not equal to each other, and wherein the second candidate mode set includes a candidate mode, which index value is larger than the maximum value or the minimum value by 2, or smaller than the maximum value or the minimum value by 2, wherein, based on that the intra prediction mode of the left block being not equal to the intra prediction mode of the upper block and one of the intra prediction mode of the left block and the intra prediction mode of the upper block being a DC mode, the second candidate mode set includes a candidate mode, which index value is larger than the maximum value by
 2. 5. The image decoding method of claim 4, wherein, in response to neither the first candidate mode set nor second candidate mode set being selected based on the candidate mode set selecting information, the candidate mode selecting information indicates a candidate mode among candidate modes included in the third candidate mode set.
 6. The image decoding method of claim 4, wherein the second candidate mode set comprises a mode corresponding to the maximum value and a mode corresponding to the minimum value.
 7. A non-transitory computer-readable recording-medium storing a bitstream which is generated by an image encoding method, the method comprising: determining, among one or more candidate mode sets, a candidate mode set in which an intra prediction mode of a current block is included; encoding candidate mode set selecting information indicating a candidate mode set of the current block among one or more candidate mode sets, the one or more candidate mode sets comprising a first candidate mode set including one or more candidate modes, a second candidate mode set including one or more candidate modes, and a third candidate mode set including remaining candidate modes; encoding, in response to the candidate mode set of the current block comprises two or more candidate modes, candidate mode selecting information indicating the intra prediction mode of the current block among the two or mode candidate modes; and predicting the current block based on the intra-prediction mode of the current block, wherein a candidate mode included in the second candidate mode set is derived based on a maximum value and a minimum value among an index value of an intra prediction mode of a left block adjacent to the current block and an index value of an intra prediction mode of an upper block adjacent to the current block, in response to the intra prediction mode of the left block and the intra prediction mode of the upper block are not equal to each other, and wherein the second candidate mode set includes a candidate mode, which index value is larger than the maximum value or the minimum value by 2, or smaller than the maximum value or the minimum value by 2, wherein, based on that the intra prediction mode of the left block being not equal to the intra prediction mode of the upper block and one of the intra prediction mode of the left block and the intra prediction mode of the upper block being a DC mode, the second candidate mode set includes a candidate mode, which index value is larger than the maximum value by
 2. 